$(function () {
    var zt = $('#zt').val();
    if (zt == "0" || zt == "1") {
        //将所有input中title 为val的框子变成不可编译状态
        setInputToHide("val");
    } else if (zt == "2" || zt == "3") {
        //将所有input中title 为add的框子变成不可编译状态
        setInputToShow("val", "add");
    }
});


//将所有input框的title=title变成不可编译状态
function setInputToHide(title) {
    var inputs = $("[atitle='" + title + "']");
    inputs.each(function () {
        $(this).parent().parent().hide();
    });
}

function setInputToShow(title, titleDetail) {
    var inputs = $("[atitle='" + title + "']");
    inputs.each(function () {
        $(this).parent().parent().show();
    });

    var inputs = $("[atitle='" + titleDetail + "']");
    inputs.each(function () {
        if ($(this).attr("id") == "scrq" || $(this).attr("id") == "ysrq" || $(this).attr("id") == "dhrq") {
            $(this).datebox({disabled:"true"});
        } else {
            $(this).attr("readonly", "readonly").attr("style", "background-color:#F8F8FF;").attr("class", "input-text-border-zero");
        }
    });

}